package FiveHomeworkDesign.Observer;

/**
 * @author 北巷_东坡
 * @date 2022/11/21 22:26
 * @computer 10741
 */
public class Player206 extends Observer206{
    public Player206(String name) {
        this.name = name;
    }

    @Override
    public void beAttacked() {
        System.out.println(name + "遭受敌人攻击");
        if (Allay206 != null) {
            Allay206.notifyMembers(name);
        } else {
            System.out.println(name + "没有联盟，没人帮你");
        }
    }

    @Override
    public void help(String name) {
        System.out.println(this.name + "来救" + name);
    }
}
